﻿using QControlCenter.ViewModel;
using QServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace QControlCenter
{
    /// <summary>
    /// Login.xaml 的交互逻辑
    /// </summary>
    public partial class Login : HandyControl.Controls.Window
    {
        public Login()
        {

            InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            var vm = new LoginViewModel();
            this.DataContext = vm;


        }

        private void CancelCkick(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
        private void LoginBtnClick(object sender, RoutedEventArgs e)
        {
            if (this.DataContext != null && this.DataContext is LoginViewModel vm)
            {
                vm.Login();
                this.Close();
            }
        }
    }
}
